home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2008 February / PCWFEB08.iso / Software / Freeware / Miro 1.0 / Miro_Installer.exe / chrome / content / checkbox_dialog.xul < prev    next >
Encoding:
Extensible Markup Language  |  2007-11-12  |  1.6 KB  |  42 lines

  1. <?xml version="1.0"?>
  2. <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
  3. <?xml-stylesheet href="main.css" type="text/css"?>
  4.  
  5. <dialog id="democracy-dialog"
  6.     xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  7.     xmlns:html="http://www.w3.org/1999/xhtml"
  8.         title=""
  9.         maxwidth="400"
  10.         buttons="accept,cancel"
  11.         ondialogaccept="onaccept();"
  12.         ondialogcancel="oncancel();"
  13.         onload="onload()">
  14.     <script type="text/javascript">
  15. function onload() {
  16.   var args = window.arguments[0];
  17.   var description = document.getElementById("description");
  18.   description.appendChild(document.createTextNode(args["description"]));
  19.   var dialog = document.getElementById("democracy-dialog");
  20.   document.title = args['title'];
  21.   dialog.getButton('accept').label = args['defaultLabel'];
  22.   dialog.getButton('cancel').label = args['otherLabel'];
  23.   var checkbox = document.getElementById('checkbox');
  24.   checkbox.checked = args['checkboxValue'];
  25.   checkbox.label = args['checkboxText'];
  26. }
  27.  
  28. var pybridge = Components.classes["@participatoryculture.org/dtv/pybridge;1"].
  29.                 getService(Components.interfaces.pcfIDTVPyBridge);
  30. function onaccept() {
  31.   var value = document.getElementById('checkbox').checked;
  32.   pybridge.handleCheckboxDialog(window.arguments[0]['id'], 0, value);
  33. }
  34. function oncancel() {
  35.   var value = document.getElementById('checkbox').checked;
  36.   pybridge.handleCheckboxDialog(window.arguments[0]['id'], 1, value);
  37. }
  38.    </script>
  39.    <description id="description" />
  40.    <checkbox id="checkbox" />
  41. </dialog>
  42.